<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>收货地址</title>
</head>
<body>
{layout name="layout" /}
    <div class="management f-r">
        <form   action="{:url('home/user/siteAdd')}" method="post" id="bb">
            <div class="tanchuang-con">
                <div class="tc-title">
                    <h3>我的收货地址</h3>
                </div>
                <font class="xinxi" >请认真填写以下信息！</font>
                <ul class="tc-con2" >
                    <li class="tc-li1">
                        <p class="l-p">所在地区<span>*</span></p>
                        <div id="province" name=""></div>
                        <div style="clear:both;"></div>
                    </li>
                    <li class="tc-li1">
                        <p class="l-p">详细地址<span>*</span></p>
                        <textarea class="textarea1" placeholder="请如实填写您的详细信息，如街道名称、门牌号、楼层号和房间号。" name="address"></textarea>
                        <div style="clear:both;"></div>
                    </li>
                    <li class="tc-li1">
                        <p class="l-p">邮政编码<span></span></p>
                        <input type="text" name="code">
                        <div style="clear:both;"></div>
                    </li>
                    <li class="tc-li1">
                        <p class="l-p">收货人姓名<span>*</span></p>
                        <input type="text" name="name">
                        <div style="clear:both;"></div>
                    </li>
                    <li class="tc-li1">
                        <p class="l-p">联系电话<span>*</span></p>
                        <input type="text" name="tel">
                        <div style="clear:both;"></div>
                    </li>
                </ul>
                <button class="btn-pst2" >保存</button>
            </div>
        </form>
        <div class="man-info">
            <div class="man-if-con">
                <div class="man-tit">
                    <p class="p1">收货人</p>
                    <p class="p2">所在地区</p>
                    <p class="p3">详细地址</p>
                    <p class="p4">邮编</p>
                    <p class="p5">电话/手机</p>
                    <p class="p6">操作</p>
                </div>
                <ul class="man-ul1">
                    {foreach $siteInfo as $vo}
                        <li>
                            <p class="p1">{$vo['name']}</p>
                            <p class="p2">{$vo['region']}</p>
                            <p class="p3">{$vo['address']}</p>
                            <p class="p4">{$vo['code']}</p>
                            <p class="p5">{$vo['tel']}</p>
                            <p class="p6">
                                <a title="编辑" href="javascript:;"onclick="admin_permission_edit('收货地址修改','{:url('home/user/siteEdit')}?id={$vo['id']}','1','','600')">修改</a> |
                                <a title="删除" href="javascript:;" onclick="admin_role_del({$vo['id']})" href="">删除</a>
                            </p>
                            <div style="clear:both;"></div>
                        </li>
                    {/foreach}
                </ul>
            </div>
        </div>
    </div>
<script>
    $(function(){
        $("#province").ProvinceCity()});
    function admin_permission_edit(title,url,id,w,h){
        layer_show(title,url,w,h);
    }
    function admin_role_del(id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                type: 'POST',
                url: "{:url('home/user/siteDel')}",
                dataType: 'json',
                data:{id:id},
                success: function(data){
                    if(data.status == -1){
                        layer.msg(data.msg,{icon:2,time:1000});
                    }else{
                        layer.msg('已删除!',{icon:1,time:1000},function () {
                            window.location.reload();
                        });
                    }
                },

            });
        });
    }
</script>
</body>
</html>